<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>微信用户管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
      /*  function  editStatus(id,status) {
			var id = id;
			$.ajax({
				url : "${ctx}/sys/tbUserVerify/edit",
				async : false,
				type : "post",
				data : {
					"id" : id,
					"auditorState" : status,
				},
				success : function(data) {
					if(data.auditorState==1){
						var id = data.id;
						$("#"+id+"").html("审核通过");
					}else if(data.auditorState==2){
						var id = data.id;
						$("#"+id+"").html("审核不通过");
					}
				}
			});
		}*/
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/wechat/tbuserList">微信用户列表</a></li>
		<%--<shiro:hasPermission name="sys:user:edit"><li><a href="${ctx}/sys/tbUserVerify/form">身份证审核添加</a></li></shiro:hasPermission>--%>
	</ul>
	<form:form id="searchForm" modelAttribute="tbUser" action="${ctx}/sys/wechat/tbuserList" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>实名状态：</label>
				<select id="box" name="auditorState" class="input-medium">
					<option value="-1">全部</option>
						<option  value="0" <c:if test="${tbUser.auditorState=='0'}">selected</c:if> >审核中</option>
						<option  value="1" <c:if test="${tbUser.auditorState=='1'}">selected</c:if>>通过</option>
						<option  value="2" <c:if test="${tbUser.auditorState=='2'}">selected</c:if>>驳回</option>
						<option  value="3" <c:if test="${tbUser.auditorState=='3'}">selected</c:if>>未实名认证</option>
				</select>
			</li>&nbsp;&nbsp;
			<li class="btns">&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<span><font style="color: #00A6C7">${message1}</font></span>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>地址</th>
				<th>手机号</th>
				<th>性别</th>
				<th>实名状态</th>
				<th>物业钱包余额</th>
				<th>麻雀钱包余额</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="tbUser">
			<tr>
				<td>${tbUser.address}</td>
				<td>${tbUser.mobile}</td>
				<td>${tbUser.sex}</td>
				<td>
					<c:choose>
						<c:when test="${tbUser.auditorState==0}">
							审核中
						</c:when>
						<c:when test="${tbUser.auditorState==1}">
							通过
						</c:when>
						<c:when test="${tbUser.auditorState==2}">
							驳回
						</c:when>
						<c:otherwise>
							未实名认证
						</c:otherwise>
					</c:choose>
				</td>
				<td><a href="${ctx}/sys/wechat/tenementWallet?uid=${tbUser.uid}"><fmt:formatNumber value="${tbUser.totalMoney}" pattern="0.00"/></a></td>
				<td><a href="${ctx}/sys/wechat/mqWallet?uid=${tbUser.uid}"><fmt:formatNumber value="${tbUser.mqtotalMoney}" pattern="0.00"/></a></td>
				<td>
					<c:choose>
						<c:when test="${tbUser.isDelete==0}">
							<a href="javascript:isChange(${tbUser.uid});">冻结</a>
						</c:when>
						<c:when test="${tbUser.isDelete==1}">
							<a href="javascript:isChange1(${tbUser.uid});">解冻</a>
						</c:when>
					</c:choose>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
<script>
	function isChange(id){
		if(confirm("确认要冻结该用户吗？")){
			location.href="${ctx}/sys/wechat/isDelete?uid="+id+"&isDelete=1";
		}
	}
	function isChange1(id){
		if(confirm("确认要解冻该用户吗？")){
			location.href="${ctx}/sys/wechat/isDelete?uid="+id+"&isDelete=0";
		}
	}
</script>
</body>
</html>